home *** CD-ROM | disk | FTP | other *** search
/ Adventure Games / Adventure Games 1.iso / panic / panic.exe / panic.DXR / 00246.ls < prev    next >
Encoding:
Text File  |  1995-08-24  |  6.4 KB  |  151 lines

  1. on @ whichSprite
  2.   if the type of sprite whichSprite = 0 then
  3.     put "There is no sprite in channel " & whichSprite & "."
  4.   else
  5.     set item1 to "Sprite loc: " & point(the locH of sprite whichSprite, the locV of sprite whichSprite)
  6.     set centerH to ((the right of sprite whichSprite - the left of sprite whichSprite) / 2) + the left of sprite whichSprite
  7.     set centerV to ((the bottom of sprite whichSprite - the top of sprite whichSprite) / 2) + the top of sprite whichSprite
  8.     set item2 to "   Sprite center: " & point(centerH, centerV)
  9.     put item1 & item2
  10.   end if
  11. end
  12.  
  13. on ? whichSprite
  14.   if the type of sprite whichSprite = 0 then
  15.     put "There is no sprite in channel " & whichSprite & "."
  16.   else
  17.     set whichCast to the castNum of sprite whichSprite
  18.     set whichCastName to whichCast
  19.     if the name of cast whichCast > 0 then
  20.       set whichCastName to QUOTE & the name of cast whichCast & QUOTE
  21.     end if
  22.     set item1 to "Sprite: " & whichSprite & "   Cast: " & whichCastName & "   Type: " & the type of sprite whichSprite
  23.     set item1 to item1 & ", " & the castType of cast whichCast
  24.     set item2 to "   Ink: " & the ink of sprite whichSprite
  25.     set item3 to "   Sprite loc: " & point(the locH of sprite whichSprite, the locV of sprite whichSprite)
  26.     set item4 to "   Top left corner: " & point(the left of sprite whichSprite, the top of sprite whichSprite)
  27.     set item5 to "   Bottom right corner: " & point(the right of sprite whichSprite, the bottom of sprite whichSprite)
  28.     set item6 to "   Stretch: " & the stretch of sprite whichSprite & "   Cursor: " & the cursor of sprite whichSprite
  29.     set item7 to RETURN & RETURN & "To activate sprite [ whichSprite ] , copy this into your script:    "
  30.     set item8 to "activate [ whichSprite ] , " & whichCastName & ", " & the type of sprite whichSprite & ", " & the ink of sprite whichSprite & ", "
  31.     if the stretch of sprite whichSprite = 0 then
  32.       set item9 to the locH of sprite whichSprite & ", " & the locV of sprite whichSprite & ", "
  33.       set item9 to item9 & QUOTE & QUOTE & ", " & QUOTE & QUOTE & ", " & QUOTE
  34.     else
  35.       set item9 to the left of sprite whichSprite & ", " & the top of sprite whichSprite & ", " & QUOTE & "stretch to:" & QUOTE & ", "
  36.       set item9 to item9 & the right of sprite whichSprite & ", " & the bottom of sprite whichSprite & RETURN
  37.     end if
  38.     put item1 & item2 & item3 & item4 & item5 & item6 & item7 & item8 & item9
  39.   end if
  40. end
  41.  
  42. on ! whichSprite
  43.   if value(whichSprite) > 0 then
  44.     if the type of sprite whichSprite = 0 then
  45.       put "Cursor location: " & point(the mouseH, the mouseV)
  46.       put "There is no sprite in channel " & whichSprite & "."
  47.     else
  48.       put "Cursor location: " & point(the mouseH, the mouseV)
  49.       set item1 to "Cursor location, relative to the top left corner of sprite " & whichSprite & ": "
  50.       set item2 to point(the mouseH - the left of sprite whichSprite, the mouseV - the top of sprite whichSprite)
  51.       put item1 & item2
  52.     end if
  53.   else
  54.     put "Cursor location: " & point(the mouseH, the mouseV)
  55.   end if
  56. end
  57.  
  58. on activate whichSprite, targetCast, targetType, targetInk, targetH, targetV, stretchBool, targetH2, targetV2
  59.   puppetSprite(whichSprite, 1)
  60.   set the type of sprite whichSprite to targetType
  61.   set the castNum of sprite whichSprite to the number of cast targetCast
  62.   set the ink of sprite whichSprite to targetInk
  63.   set the foreColor of sprite whichSprite to 255
  64.   set the backColor of sprite whichSprite to 0
  65.   set the locH of sprite whichSprite to targetH
  66.   set the locV of sprite whichSprite to targetV
  67.   if stretchBool = EMPTY then
  68.     set the stretch of sprite whichSprite to 0
  69.   else
  70.     set the stretch of sprite whichSprite to 1
  71.     if targetH2 <> EMPTY then
  72.       spriteBox(whichSprite, targetH, targetV, targetH2, targetV2)
  73.     end if
  74.   end if
  75.   set the immediate of sprite whichSprite to 1
  76. end
  77.  
  78. on deactivate spriteList
  79.   if listp(spriteList) then
  80.     set repeatLimit to count(spriteList)
  81.     repeat with theCount = 1 to repeatLimit
  82.       set whichSprite to getAt(spriteList, 1)
  83.       set the type of sprite whichSprite to 0
  84.       puppetSprite(whichSprite, 0)
  85.       deleteAt(spriteList, 1)
  86.     end repeat
  87.   end if
  88. end
  89.  
  90. on store spriteList
  91.   global gStoredSpriteInfo
  92.   if listp(spriteList) then
  93.     if not listp(gStoredSpriteInfo) then
  94.       set gStoredSpriteInfo to []
  95.     end if
  96.     set repeatLimit to count(spriteList)
  97.     repeat with theCount = 1 to repeatLimit
  98.       set x to getAt(spriteList, 1)
  99.       set spriteXinfo to [the type of sprite x]
  100.       if the type of sprite x > 0 then
  101.         append(spriteXinfo, the puppet of sprite x)
  102.         append(spriteXinfo, the castNum of sprite x)
  103.         append(spriteXinfo, the ink of sprite x)
  104.         append(spriteXinfo, the foreColor of sprite x)
  105.         append(spriteXinfo, the backColor of sprite x)
  106.         append(spriteXinfo, the locH of sprite x)
  107.         append(spriteXinfo, the locV of sprite x)
  108.         if the castType of cast the castNum of sprite x = #digitalVideo then
  109.           append(spriteXinfo, the movieTime of sprite x)
  110.           append(spriteXinfo, the movieRate of sprite x)
  111.         end if
  112.       end if
  113.       setAt(gStoredSpriteInfo, x, spriteXinfo)
  114.       deleteAt(spriteList, 1)
  115.     end repeat
  116.   end if
  117. end
  118.  
  119. on restore spriteList
  120.   global gStoredSpriteInfo
  121.   if listp(spriteList) then
  122.     if not listp(gStoredSpriteInfo) then
  123.       set gStoredSpriteInfo to []
  124.     end if
  125.     set repeatLimit to count(spriteList)
  126.     repeat with theCount = 1 to repeatLimit
  127.       set x to getAt(spriteList, 1)
  128.       if count(gStoredSpriteInfo) >= x then
  129.         set spriteXinfo to getAt(gStoredSpriteInfo, x)
  130.         if listp(spriteXinfo) then
  131.           set the type of sprite x to getAt(spriteXinfo, 1)
  132.           if getAt(spriteXinfo, 1) > 0 then
  133.             set the puppet of sprite x to getAt(spriteXinfo, 2)
  134.             set the castNum of sprite x to getAt(spriteXinfo, 3)
  135.             set the ink of sprite x to getAt(spriteXinfo, 4)
  136.             set the foreColor of sprite x to getAt(spriteXinfo, 5)
  137.             set the backColor of sprite x to getAt(spriteXinfo, 6)
  138.             set the locH of sprite x to getAt(spriteXinfo, 7)
  139.             set the locV of sprite x to getAt(spriteXinfo, 8)
  140.             if count(spriteXinfo) >= 10 then
  141.               set the movieTime of sprite x to getAt(spriteXinfo, 9)
  142.               set the movieRate of sprite x to getAt(spriteXinfo, 10)
  143.             end if
  144.           end if
  145.         end if
  146.       end if
  147.       deleteAt(spriteList, 1)
  148.     end repeat
  149.   end if
  150. end
  151.